﻿--	创建表空间（以GCPS_DB为例）
--  注意对表空间名、文件路径进行适当修改

CREATE TABLESPACE GCPS_DB DATAFILE 
  '/oracle/oradata/orcl/GCPS_DB.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;

--	创建用户（以GCPS_USER为例，密码为“gcps”，此处密码不能全为数字）

CREATE USER GCPS_USER IDENTIFIED BY gcps
  DEFAULT TABLESPACE GCPS_DB
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK;

--  给用户授权
  -- 3 Roles for GCPS_USER 
  GRANT CONNECT TO GCPS_USER;
  GRANT DBA TO GCPS_USER;
  GRANT RESOURCE TO GCPS_USER;

  -- 1 System Privileges for GCPS_USER 
  GRANT UNLIMITED TABLESPACE TO GCPS_USER;

  -- 1 Tablespace Quota for GCPS_USER 
  ALTER USER GCPS_USER QUOTA UNLIMITED ON GCPS_DB;
